import React ,{useEffect} from 'react'
import * as api from "./api/index"
import {useDispatch,useSelector} from "react-redux"

function App() {
    const dispatch = useDispatch()
    const list = useSelector((state)=>{
        console.log(state);
        return state.reducer.list.length>0?state.reducer.list[0].children:[]
    })
    useEffect(()=>{
      dispatch(api.get_tabs())
    },[dispatch])
    console.log(list,11111111);
    return (
        <div>
            App
            {
                list&&list.map((item)=>{
                    return <p> {item.itle}</p>
                })
            }
        </div>
    )
}

export default App
